import numpy as np
import torch

import matplotlib.mlab as mlab
import torchvision
from matplotlib import pyplot as plt
import torch.nn as nn
import torchvision.transforms as transforms
# 读取一张图
class Modual(torch.nn.Module):
    def __init__(self):
        super(Modual,self).__init__()
        self.fc1 = nn.Linear(10, 5)
        self.bn = nn.BatchNorm1d(5)
        self.fc2 = nn.Linear(5, 2)

    def forward(self,x):
        x = x.view(x.size()[0], -1)
        x = self.fc1(x)
        x = nn.functional.relu(x)
        x = self.fc2(x)

        return x

m = nn.BatchNorm1d(1)  # bn设置的参数实际上是channel的参数
# net = Modual()
# print(net)
#
a = torch.randn(1000,1)
# a = a[torch.LongTensor([0])]
output = m(a)
# output = net(a)
print(output)



